//
//  GMGallery.h
//  gentleman
//
//  Created by 范月成 on 2017/12/6.
//  Copyright © 2017年 fancy. All rights reserved.
//

#import <Foundation/Foundation.h>

@class GMGallery;
@class TFHpple;

typedef void (^getGalleryCompleted)(NSError *error, GMGallery *gallery);

@interface GMGalleryComment : NSObject

@property (nonatomic, copy) NSString *repostTime;
@property (nonatomic, copy) NSString *reporter;
@property (nonatomic, copy) NSString *score;
@property (nonatomic, copy) NSString *content;

@end

@interface GMGalleryInfo : NSObject

@property (nonatomic, copy) NSString *posted;
@property (nonatomic, copy) NSString *parent;
@property (nonatomic, copy) NSString *visible;
@property (nonatomic, copy) NSString *language;
@property (nonatomic, copy) NSString *size;
@property (nonatomic, copy) NSString *length;
@property (nonatomic, copy) NSString *favorited;

@end

@interface GMGalleryTag : NSObject

@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSArray *tags;

- (instancetype)initWithName:(NSString *)name
                        tags:(NSArray *)tags;

@end

@interface GMGallery : NSObject

@property (nonatomic, strong) GMGalleryInfo *info;      //基础信息
@property (nonatomic, copy) NSString *thumbnail;        //缩略图合集
@property (nonatomic, copy) NSArray *comments;          //评论
@property (nonatomic, copy) NSArray *tagArr;            //tag
@property (nonatomic, assign) BOOL isFavorite;          //是否收藏
@property (nonatomic, copy) NSString *testUrl;          //获取showkey的链接
@property (nonatomic, copy) NSString *showkey;          //24小时变换的token
@property (nonatomic, copy) NSString *apiuid;
@property (nonatomic, copy) NSString *apikey;

+ (void)getWithArtworkUrl:(NSString *)url
                completed:(getGalleryCompleted)completed;

- (instancetype)initWithParser:(TFHpple *)parser;
- (void)requestShowkey:(getGalleryCompleted)completed;

@end
